//
//  Model_Hr_Question_Item.m
//  NursingManages
//
//  Created by Zhen Huang on 17/9/14.
//  Copyright © 2017年 huangzhen. All rights reserved.
//

#import "Model_Hr_Question_Item.h"

@implementation Model_Hr_Question_Item

- (id)initWithDictionary:(NSDictionary *)dic
{
    if (self) {
        self.QUES_ID = [dic objectForKey:@"QUES_ID"];
        self.TITLE = [dic objectForKey:@"TITLE"];
        self.TYPEID = [dic objectForKey:@"TYPEID"];
        self.BANKID = [dic objectForKey:@"BANKID"];
        self.ANSWER = [dic objectForKey:@"ANSWER"];
        self.CASEID = [dic objectForKey:@"CASEID"];
        self.ACTUAL_SCORE = [[dic objectForKey:@"ACTUAL_SCORE"]integerValue];
        self.OPTION1 = [dic objectForKey:@"OPTION1"]?:@"";
        self.OPTION2 = [dic objectForKey:@"OPTION2"]?:@"";
        self.OPTION3 = [dic objectForKey:@"OPTION3"]?:@"";
        self.OPTION4 = [dic objectForKey:@"OPTION4"]?:@"";
        self.OPTION5 = [dic objectForKey:@"OPTION5"]?:@"";
        self.OPTION6 = [dic objectForKey:@"OPTION6"]?:@"";
        self.OPTION7 = [dic objectForKey:@"OPTION7"]?:@"";
        self.OPTION8 = [dic objectForKey:@"OPTION8"]?:@"";
        self.OPTION9 = [dic objectForKey:@"OPTION9"]?:@"";
        self.OPTION10 = [dic objectForKey:@"OPTION10"]?:@"";
        self.ORDER_NUM = [dic objectForKey:@"ORDER_NUM"];
        self.THOUGHTS = [dic objectForKey:@"THOUGHTS"];
        self.VAL = [dic objectForKey:@"VAL"];
        self.DIF_LEVEL = [dic objectForKey:@"DIF_LEVEL"];
        self.ANSWER_FLAG = [dic objectForKey:@"ANSWER_FLAG"];
        self.answers = [dic objectForKey:@"answers"];

    }
    return self;
}

- (NSArray *)optionArray {
    NSMutableArray *answerArray = [[NSMutableArray alloc]init];
    
    if (self.OPTION1 != nil && ![self.OPTION1 isEqual:[NSNull null]]) {
        [answerArray addObject:self.OPTION1];
    }
    if (self.OPTION2 != nil && ![self.OPTION2 isEqual:[NSNull null]]) {
        [answerArray addObject:self.OPTION2];
    }
    if (self.OPTION3 != nil && ![self.OPTION3 isEqual:[NSNull null]]) {
        [answerArray addObject:self.OPTION3];
    }
    if (self.OPTION4 != nil && ![self.OPTION4 isEqual:[NSNull null]]) {
        [answerArray addObject:self.OPTION4];
    }
    if (self.OPTION5 != nil && ![self.OPTION5 isEqual:[NSNull null]]) {
        [answerArray addObject:self.OPTION5];
    }
    if (![self.OPTION6 isEqual:[NSNull null]] && self.OPTION6 != nil ) {
        [answerArray addObject:self.OPTION6];
    }
    if (![self.OPTION7 isEqual:[NSNull null]] && self.OPTION7 != nil) {
        [answerArray addObject:self.OPTION7];
    }
    if (![self.OPTION8 isEqual:[NSNull null]] && self.OPTION8 != nil) {
        [answerArray addObject:self.OPTION8];
    }
    if (![self.OPTION9 isEqual:[NSNull null]] && self.OPTION9 != nil) {
        [answerArray addObject:self.OPTION9];
    }
    if (![self.OPTION10 isEqual:[NSNull null]]&& self.OPTION10 != nil ) {
        [answerArray addObject:self.OPTION10];
    }
    return answerArray;
}

@end
